package com.qf.sportsevent.entity;

import android.databinding.ObservableInt;

import com.qf.sportsevent.BR;
import com.qf.sportsevent.R;
import com.qf.sportsevent.adapter.CommonPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/12/19.
 */

public class NewsBannersListHolderEntity {
    private List<NewsBannersEntity> newsBanners;
    private ObservableInt currentPage = new ObservableInt(0);
    private CommonPagerAdapter<NewsBannersEntity> adapter;

    public NewsBannersListHolderEntity(List<NewsBannersEntity> newsBanners) {
        this.newsBanners = newsBanners;
    }

    public List<NewsBannersEntity> getNewsBanners() {
        return newsBanners;
    }

    public void setNewsBanners(List<NewsBannersEntity> newsBanners) {
        this.newsBanners = newsBanners;
    }

    public ObservableInt getCurrentPage() {
        return currentPage;
    }

    public CommonPagerAdapter getAdapter(){
        if(adapter == null) {
            adapter = new CommonPagerAdapter<>(newsBanners, R.layout.news_item_1_vp_detail, BR.bannerImg);
        }
        return adapter;
    }

}
